package com.yunshipei.common.wedigt;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.yunshipei.enterplorer.R;


public class YspButton extends FrameLayout {
    public YspButton(Context context) {
        this(context, null);
    }

    public YspButton(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public YspButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    private TextView mBgView;
    private TextView mTopView;

    private void init(Context context) {
        if (isInEditMode()) {
            return;
        }
        inflate(context, R.layout.btn_item_click_bg, this);
        mBgView = (TextView) findViewById(R.id.tv_bg_view);
        mTopView = (TextView) findViewById(R.id.tv_top_view);
    }

    public void setBtnText(String text) {
        mBgView.setText(text);
    }

    public void setTextSize(int size) {
        mBgView.setTextSize(size);
    }

    public void setTopTvClickListener(OnClickListener listener) {
        mTopView.setOnClickListener(listener);
    }

}
